<?
require('./application/views/header.php');

?>

  	<div id="content">

<h2>Kalender</h2>

		 <? if($this -> exists('prevPage') || $this -> exists('nextPage')){ ?>   
				 <ul class="page_menu">
            <? if($this -> exists('prevPage')){ ?>
            <li><a href="<?=$this -> prevPage?>" class="backBtn"><?=$this -> prevPageName?></a></li>
            <? }
				if($this -> exists('nextPage')){
			 ?>
            <li><a href="<?=$this -> nextPage?>" class="forBtn"><?=$this -> nextPageName?></a></li>
            <?
			}
			?>
            </ul>
				
				
			<? } ?>
            
            <div id="infoDiv">
            	<?= $this -> infoText; ?> 
            </div>
<table cellpadding="0" cellspacing="0">

		<? foreach($this -> dagen as $dag){
				$bool = true;
				?>
                	
                    <tr><td class="number"><?= $dag -> getNummer() ?></td><td class="aantal">
                    <? 
						
						$acti = $dag -> getActivities();
						
						
						
						if(count($acti) == 1){
							echo "Er is <strong>1</strong> activiteit op deze dag";
						}elseif(count($acti) > 1){
							
							echo "Er zijn <strong>" . count($acti) . "</strong> activiteiten op deze dag";
						
						}else{
							echo '&nbsp;';
							$bool = false;
						}
					
					?>
                   </td>
                   <td>
                   <?
				   if($bool){
				   
				   	echo '<a href="/kalender/activiteiten/'.$dag -> getJaar().'/'.$dag -> getMaand().'/'.$dag -> getNummer().'/">Bekijk deze dag</a>';
				   
				   }else{
				   	echo '&nbsp;';
				   }
				   ?>
                   </td>
                   </tr>
                    
                
                <? 
		
			}
            ?>
            
            
            </table>
            
             <? if($this -> exists('prevPage') || $this -> exists('nextPage')){ ?>   
				 <ul class="page_menu">
            <? if($this -> exists('prevPage')){ ?>
            <li><a href="<?=$this -> prevPage?>" class="backBtn"><?=$this -> prevPageName?></a></li>
            <? }
				if($this -> exists('nextPage')){
			 ?>
            <li><a href="<?=$this -> nextPage?>" class="forBtn"><?=$this -> nextPageName?></a></li>
            <?
			}
			?>
            </ul>
				
				
			<? } ?>
            
        </div>
   
<? include('footer.php'); ?>